home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- * Title : ADFS::$.h.interface
- * System : Risc-OS library
- * Version : 1.25
- * Copyright : © Software Interrupt
- * Date : 25nd September, 1990
- * Author : Simon Huntington
- *
- * Function : Headers for Interface functions
- *
- */
-
- #include "wimpt.h"
- #include "wimp.h"
- #include "os.h"
-
-
-
-
-
-
- /*
- *============================================================================
- *
- * Hash defines the swi numbers
- *
- *============================================================================
- */
-
- #define wimp_borderi 0x81680
- #define wimp_borderw 0x81681
- #define wimp_claim 0x81682
- #define wimp_release 0x81683
- #define wimp_setworkpointer 0x81684
- #define wimp_relworkpointer 0x81685
- #define wimp_pollpoint 0x81686
- #define wimp_help 0x81687
-
-
-
-
-
- /*
- *============================================================================
- *
- * Define the structure for a pointer
- *
- *============================================================================
- */
-
- typedef struct
- {
- int window_handle,
- x0,
- y0,
- x1,
- y1;
- char ptr_validation [24];
- } wimp_pointer;
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to border an icon
- *
- * Parameters : mouse - mouse string containg icon, window, buttons
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *wimp_bordericon (mouse)
-
- wimp_mousestr mouse;
-
- {
- os_regset regs;
- os_error *error;
-
- regs.r[1] = (int) &mouse;
- error = os_swix (wimp_borderi, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to border a window
- *
- * Parameters : redraw_box - a redraw box as returned from wimp_EREDRAW
- * poll code
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *wimp_borderwindow (redraw_box)
-
- wimp_redrawstr redraw_box;
-
- {
- os_regset regs;
- os_error *error;
-
-
- regs.r[1] = (int) &redraw_box;
- error = os_swix (wimp_borderw, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to allow application to use Interface pointers
- *
- * Parameters : None
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *wimp_claiminterface (void)
- {
- os_regset regs;
- os_error *error;
-
- regs.r[0] = (int) wimpt_task ();
- error = os_swix (wimp_claim, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to stop the application using pointers and remove any workspace
- * used by the application
- *
- * Parameters : None
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *wimp_releaseinterface (void)
- {
- os_regset regs;
- os_error *error;
-
- regs.r[0] = (int) wimpt_task ();
- error = os_swix (wimp_release, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to set a workarea pointer
- *
- * Parameters : pointer - a pointer block as described at the start
- * of this header
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *wimp_setworkareapointer (pointer)
-
- wimp_pointer pointer;
-
- {
- os_regset regs;
- os_error *error;
-
- regs.r[1] = (int) &pointer;
- error = os_swix (wimp_setworkpointer, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to release a workarea pointer
- *
- * Parameters : pointer - a pointer block as described at the start
- * of this header
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *wimp_releaseworkareapointer (pointer)
-
- wimp_pointer pointer;
-
- {
- os_regset regs;
- os_error *error;
-
- regs.r[0] = (int) wimpt_task ();
- regs.r[1] = (int) &pointer;
- error = os_swix (wimp_relworkpointer, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to swap pointers when over an icon or the appropriate workarea
- *
- * Parameters : poll - the wimp poll reason code
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *wimp_pollpointer (poll)
-
- int poll;
-
- {
- os_regset regs;
- os_error *error;
-
- regs.r[0] = (int) poll;
- regs.r[2] = (int) wimpt_task ();
- error = os_swix (wimp_pollpoint, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to send help to the help application
- *
- * Parameters : message_block - the message block from the help
- * application
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *wimp_sendhelp (message_block)
-
- wimp_msghdr *message_block;
-
- {
- os_regset regs;
- os_error *error;
-
- regs.r[1] = (int) message_block;
- error = os_swix (wimp_help, ®s);
-
- return error;
- }
-
-